package com.ins1st.plus.util;

import java.util.Calendar;
import java.util.Date;

/**
 * @program: ins1st-plus
 * @description: 时间工具类
 * @author: coderSun
 * @create: 2019-09-01 01:49
 **/
public class DateUtil {


    /**
     * 比较两个时间
     *
     * @param d1
     * @param d2
     * @return
     */
    public static int compare(Date d1, Date d2) {
        Calendar c1 = Calendar.getInstance();
        c1.setTime(d1);
        Calendar c2 = Calendar.getInstance();
        c2.setTime(d2);
        return c1.compareTo(c2);
    }
}
